<?php
// +----------------------------------------------------------------------
// | 驱动模型
// +----------------------------------------------------------------------
// | Author: 李乾坤 <261001642@qq.com>
// +----------------------------------------------------------------------
class DriverModel extends CommonModel {
	protected $_validate	=	array(
		array('title','require','请填写标题'),
		array('url','require','请选择附件'),
		/*array('password','require','请输入密码'),
		array('nickname','require','请输入昵称'),*/
		array('title','','标题重复',0,'unique',1,self::MODEL_BOTH),
	);

	protected $_auto		=	array(
		/*array('avatar','Public/Images/noavatar.jpg',self::MODEL_INSERT,'string'),
		array('sex','2',self::MODEL_INSERT,'string'),
		array('fansnum','0',self::MODEL_INSERT,'string'),
		array('renqi','0',self::MODEL_INSERT,'string'),
		array('jifen','0',self::MODEL_INSERT,'string'),
		array('money','0',self::MODEL_INSERT,'string'),
		array('email_auth','0',self::MODEL_INSERT,'string'),
		array('login_count','0',self::MODEL_INSERT,'string'),*/
		array('status','1',self::MODEL_INSERT,'string'),
		array('create_time','time',self::MODEL_INSERT,'function'),
		array('update_time','time',self::MODEL_UPDATE,'function'),
	);
    public function checkTitle() {
        if($this->getByTitle($_POST['title'])) {
            return false;
        }
        return true;
    }

}
?>